package com.samtech.spring.components;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.samtech.dto.Sale;
@Component("saleComp")
@Scope("request")
public class SaleChartComponent {

	List<Sale> sales;
	

	public void inited(){
		if(sales==null){
			sales=new ArrayList<Sale>();
			sales.add(new Sale("branch1", new BigDecimal(345)));
			sales.add(new Sale("branch2", new BigDecimal(295)));
			sales.add(new Sale("branch3", new BigDecimal(545)));
			sales.add(new Sale("branch4", new BigDecimal(385)));
		}
	}
	
	
	public List<Sale> getSales(){
		if(sales==null)inited();
		return sales;
	}

}
